//
//  SimpleTest.swift
//  ArchitectGenerics
//
//  Created by 姚胜龙 on 2017/7/6.
//  Copyright © 2017年 姚胜龙. All rights reserved.
//

import UIKit

//语法补充
class SimpleGrammarTest: NSObject {

    class func test() {
        //1、flatMap
        // 去除数组中的nil元素
        let testArray:[String?] = ["Mimi","Cici","Juan",nil,"YSL"]
        let resultArray = testArray.flatMap { $0 }
        print(resultArray)

        //2、joined 数组转字符串，并且可以指定元素与元素之间的分割字符串
        let testArray1 = ["Mimi","Cici","Juan","YSL"]
        let resultString = testArray1.joined(separator: ", ")
        print(resultString)
    }

}
